OPC Studio User's Guide and Reference
SubscribeMultipleItems(IEasyDAClient,DAItemGroupArguments[],EasyDAItemChangedEventHandler) Method



OpcLabs.EasyOpcClassicCore Assembly > OpcLabs.EasyOpc.DataAccess Namespace > IEasyDAClientExtension Class > SubscribeMultipleItems Method : SubscribeMultipleItems(IEasyDAClient,DAItemGroupArguments[],EasyDAItemChangedEventHandler) Method
The client object that will perform the operation.

This is typically the EasyDAClient object.

The value of this parameter cannot be null (Nothing in Visual Basic).

Array of arguments, one element per each OPC item involved in the operation.

The value of this parameter cannot be null (Nothing in Visual Basic).

The individual elements of the parameter value cannot be null (Nothing in Visual Basic).

A callback method to be invoked for each significant item change.

The value of this parameter can be null (Nothing in Visual Basic).

Subscribe to changes of multiple OPC items with a callback method. The ItemChanged event will be generated for each significant item change, and a specified callback method will be invoked.
Syntax
'Declaration
 
<ExtensionAttribute()>
<NotNullAttribute()>
Public Overloads Shared Function SubscribeMultipleItems( _
   ByVal client As IEasyDAClient, _
   ByVal itemGroupArgumentsArray() As DAItemGroupArguments, _
   ByVal callback As EasyDAItemChangedEventHandler _
) As Integer()
'Usage
 
Dim client As IEasyDAClient
Dim itemGroupArgumentsArray() As DAItemGroupArguments
Dim callback As EasyDAItemChangedEventHandler
Dim value() As Integer
 
value = IEasyDAClientExtension.SubscribeMultipleItems(client, itemGroupArgumentsArray, callback)

Parameters

client
The client object that will perform the operation.

This is typically the EasyDAClient object.

The value of this parameter cannot be null (Nothing in Visual Basic).

itemGroupArgumentsArray
Array of arguments, one element per each OPC item involved in the operation.

The value of this parameter cannot be null (Nothing in Visual Basic).

The individual elements of the parameter value cannot be null (Nothing in Visual Basic).

callback
A callback method to be invoked for each significant item change.

The value of this parameter can be null (Nothing in Visual Basic).

Return Value

The function returns an array of integer handles. Each such uniquely identifies the item subscription. The indices of elements in the output array are the same as those in the input array, itemGroupArgumentsArray.

This method never returns null (Nothing in Visual Basic).

Exceptions
ExceptionDescription

A null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument.

This is a usage error, i.e. it will never occur (the exception will not be thrown) in a correctly written program. Your code should not catch this exception.

Remarks

The size of the input array will become the size of the output array. The element positions (indices) in the output array are the same as in the input array.

If callback is a null reference, only the ItemChanged events are generated, but no callback method is invoked.

This is an extension method (info: C#, VB.NET). In languages that have support for extensions methods (such as C# and VB.NET), you can use the extension method as if it were a regular method on the object that is its first parameter. In other languages (such as with Python.NET), you will call the extension as a static method, and pass it the object on which it acts as its first parameter.

 

This method operates (at least in part) asynchronously, with respect to the caller. The actual execution of the operation may be delayed, and the outcome of the operation (if any) is provided to the calling code using an event notification, callback, or other means explained in the text. In a properly written program, this method does not throw any exceptions. You should therefore not put try/catch statements or similar constructs around calls to this method. The only exceptions thrown by this method are for usage errors, i.e. when your code violates the usage contract of the method, such as passing in invalid arguments or calling the method when the state of the object does not allow it. Any operation-related errors (i.e. errors that depend on external conditions that your code cannot reliably check) are indicated by the means the operation returns its outcome (if any), which is described in the text. For more information, see Do not catch any exceptions with asynchronous or multiple-operation methods.
Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also